<script setup>
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import { onMounted, onUnmounted, ref } from 'vue'
import { useBasicData } from '@/store/index'
const basicData = useBasicData()
const locale = zhCn
onMounted(() => {
  let loading = document.getElementById('preloader')
  if (loading !== null) {
    document.body.removeChild(loading)
  }
  window.addEventListener('resize', updateHeight)
  updateHeight()
})
onUnmounted(() => {
  window.removeEventListener('resize', updateHeight)
})

const updateHeight = () => {
  // console.log(window.innerHeight, 'window.innerHeight')
  basicData.contentHeight = window.innerHeight
}
</script>

<template>
  <el-config-provider :locale="locale">
    <router-view />
  </el-config-provider>
</template>
